<?
class graphProcessorUsage  extends graphBase {
	public function __construct($device,$params=array()) {
		
		if (is_array($params) || is_object($params)) {
			foreach ($params AS $name=>$value) {
				switch ($name) {
					case 'index': 
						$this->rrdFile = 'processor_'.(int)$value.'_load.rrd';
						break;
				}
			}
		}
		parent::__construct($device,$params);
	}
	
	public function getOptions() {
		return array(
			'--lower-limit','0',
			'--upper-limit','100',
			'DEF:proc='.$this->rrdPath.':usage:AVERAGE',
			'LINE1:proc#ff0000:Usage (%)  ',
			'GPRINT:proc:LAST:%3.0lf',
			'GPRINT:proc:AVERAGE:       %3.0lf',
			'GPRINT:proc:MAX:      %3.0lf\n',
			'COMMENT:Usage       Current     Average    Maximum\n'
		);
	}
}